package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.StudentInfoDao;
import com.internship.model.StudentInfo;
import com.internship.page.Page;

@Service
public class StudentInfoService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private StudentInfoDao studentInfoDao;

	public StudentInfo getStudentInfoByXH(String XH) {
		return studentInfoDao.getStudentInfoByXH(XH);
	}
	public Page<StudentInfo> getStudentInfoList(String XM,String XY,String ZYDM,String XZB,int DQSZJ,int pageNumber) {
		Page<StudentInfo> page = new Page<StudentInfo>(pageNumber, PAGE_SIZE);
		List<StudentInfo> list = studentInfoDao.getStudentInfoList(XM, XY, ZYDM, XZB, DQSZJ, page);
		page.setResultList(list);
		return page;
	}
	public Page<StudentInfo> getStudentNotMatchList(String XM,String XY,String ZYDM,String XZB,String TeacherNumber,int DQSZJ,int pageNumber) {
		Page<StudentInfo> page = new Page<StudentInfo>(pageNumber, PAGE_SIZE);
		List<StudentInfo> list = studentInfoDao.getStudentNotMatchList(XM, XY, ZYDM, XZB,TeacherNumber, DQSZJ, page);
		page.setResultList(list);
		return page;
	}
	public List<StudentInfo> getStudentInfoList() {
		List<StudentInfo> list = studentInfoDao.getStudentInfoList();
		return list;
	}
	public int addStudentInfo(StudentInfo studentInfo) {
		return studentInfoDao.addStudentInfo(studentInfo);
	}
	public int updateStudentInfo(StudentInfo studentInfo) {
		return studentInfoDao.updateStudentInfo(studentInfo);
	}
	public int updatePhone(StudentInfo studentInfo) {
		return studentInfoDao.updatePhone(studentInfo);
	}
	public int delStudentInfo(String XH) {
		return studentInfoDao.delStudentInfo(XH);
	}
	public int delAll(String[] ids) {
		return studentInfoDao.delAll(ids);
	}

}
